package ExtendsStudy.demo_07;

public class Test {

    public static void main(String[] args) {
        useInter(System.out::println);
        useInter(new InterImpl_1());
        useInter(new InterImpl_2());
    }

    public static void useInter(Inter inter) {
        inter.show();
    }


    public static Inter getInterImpl() {
        return new InterImpl_1();
    }
}


@FunctionalInterface
interface Inter {
    void show();
}

class InterImpl_1 implements Inter {
    public void eat() {

    }

    @Override
    public void show() {
        System.out.println("InterImpl_1");
    }
}

class InterImpl_2 implements Inter {
    @Override
    public void show() {
        System.out.println("InterImpl_2");
    }
}
